<template>
  <div id="news">
    <ul>
      <li v-for="(item,index) in newsList" :key="index">
        <!-- <router-link :to="`/detail?id=${item.id}&title=${item.title}`">{{item.id}}----{{item.title}}</router-link> -->
        <router-link :to="`/detail/${item.id}/${item.title}`">{{item.id}}----{{item.title}}</router-link>
        <!-- <router-link :to="{
          path:'/detail',
          query:{
            id:item.id,
            title:item.title
          }
        }"></router-link> -->
      </li>
    </ul>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  data(){
    return{
      newsList:[
        {id:'001',title:'标题1'},
        {id:'002',title:'标题2'},
      ]
    }
  },
  methods:{
    _c_look(val){
      console.log(val);
    }
  }
}
</script>

<style>

</style>